App({
  onLaunch () {
    try {
      let userinfo = my.getStorageSync({key:'userInfo'}).data;
      if (userinfo) {
        this.globalData.userInfo = JSON.parse(userinfo);
      }
      this.globalData.token = my.getStorageSync({key:'token'});
    } catch (e) {
      console.log(e);
    }
  },

  globalData: {
    userInfo: {
      nickname: '点击登录',
      avatar: '/static/images/avatar.png'
    },
    token: '',
  }
})